


import chapter2.config.AppConfig;
//import chapter2.config.UserComponent;
import chapter2.entity.UserComponent;
import chapter2.entity.User;


import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import three.lib.OtherUser;

public class Application {

    public static void main(String[] args) {
        ApplicationContext applicationContext=new AnnotationConfigApplicationContext(AppConfig.class);
        User user=applicationContext.getBean(User.class);
        UserComponent userComponet=applicationContext.getBean(UserComponent.class);
        OtherUser otherUser=applicationContext.getBean(OtherUser.class);
        System.out.println(user.getUserName());
        System.out.println(userComponet.getUserName());
        System.out.println(otherUser.getUserName());
    }
}
